﻿using Nb.Common.Web;

namespace Nb.Web.Common.Contexts
{
    /// <summary>
    /// 跟MVc的WebViewPage解耦，并解决强类型和dynamic的问题
    /// 尝试逐步替换以前的【跟页面属性耦合，接口混乱、弱类型】的页面传值帮助类
    /// 如果实例化类的全部属性使多部件渲染页面代价太大，可以用静态属性实现按需单个访问（暂不考虑！）
    /// </summary>
    public class NbViewBagUnify
    {
        public string Title { get; set; }
        public string Skin { get; set; }
        public string ThemeColor { get; set; }
        public string Area { get; set; }

        /// <summary>
        /// 内部使用的NbViewBagData.Current可以保证每个请求一个
        /// </summary>
        public static NbViewBagUnify Current
        {
            get
            {
                var nbViewBagUnify = NbViewBagData.Current.NbViewBagUnify;
                if (nbViewBagUnify == null)
                {
                    nbViewBagUnify = new NbViewBagUnify();
                    NbViewBagData.Current.NbViewBagUnify = nbViewBagUnify;
                }

                return nbViewBagUnify;
            }
        }
    }

    public class UnifySetting
    {

    }

    public class PageContent
    {

    }
}
